Using Union together with Cast and Multiset can cause your function to simply hang (even if the query works great in SQL Plus)

Many times, when an outside client is calling an oracle function it requires the results in a table format (a collection or an array or data set). The most common way to do so is using Cast and Multiset. CAST tells Oracle the required datatype for the result of an expression, and MULTISET tells Oracle … Continue reading Using Union together with Cast and Multiset can cause your function to simply hang (even if the query works great in SQL Plus)